package com.njtoyo.taxi.admin.rest.controller.business.operation_rule;

import com.njtoyo.taxi.admin.rest.wrapper.business.driver.SetDriverCancelRuleFormData;
import com.njtoyo.taxi.admin.service.business.operation_rule.DriverCancelRuleService;
import com.taxi.entity.common.RestResult;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@RestController
@Api(value = "司机手取消规则")
@RequestMapping("business/operation-rule/driver-cancel")
public class DriverCancelRuleController {
    @Autowired
    private DriverCancelRuleService driverCancelRuleService;


    /**
     * 取消设置
     *
     * @param wrapper
     * @return
     */
    @PostMapping("/set-driver-cancel-rule")
    RestResult setDriverCancel(@RequestBody @Valid SetDriverCancelRuleFormData wrapper) {
        return driverCancelRuleService.setDriverCancel(wrapper);
    }

    /**
     *
     * @return
     */
    @PostMapping("/get-driver-cancel-rule/{driverRegionId}")
    RestResult setDriverCancel(@PathVariable("driverRegionId") Long driverRegionId) {
        return driverCancelRuleService.getDriverCancel(driverRegionId);
    }
}
